public with sharing class EmailFunction {

    public static void SendEmail(List<String> toAddresses,List<String> ccAddresses, String Body, String Subject) {
        Messaging.Singleemailmessage mail=new Messaging.Singleemailmessage();
        mail.setToAddresses(toAddresses);
        mail.setCcAddresses(ccAddresses);
        mail.setSubject(Subject);
        mail.setPlainTextBody(Body);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
}